package de.uniLuebeck.tcs.algorithmics;

import java.io.*;


/**
 * Main mit Iteration um den Durchschnitt zu berechnen.
 * @author 
 *
 */
public class Main2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		long	startZeit = 0;
		long	endZeit = 0;
		
		long time = 0;
		int anzahl = 3000;
		
		for (int i=0;i<anzahl;i++){
			startZeit = System.currentTimeMillis();
			Sudoku sudoku = new Sudoku();
			
			
			try {
				BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream( "sampleInput.txt" )));
				BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream( "sampleOutput.txt" )));
			
				
				sudoku.solveProblem(reader,writer);
				endZeit = System.currentTimeMillis();
				writer.flush();
				
				time = time + (endZeit-startZeit);
				//System.out.println("Duration: " + (endZeit - startZeit) + " msec.");
				
	
			} catch (FileNotFoundException e) {
				e.printStackTrace();
				
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		
		System.out.println("Durchschnitt: "+(double)time/anzahl+" msec in "+anzahl+" Vesuchen");
	}
}
